﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLTV_Public;
using System.Data;

namespace QLTV_Data
{
  public  class PhieuYeuCau_Data
    {
      KetNoiCSDL_Data kn=new KetNoiCSDL_Data();
      public DataTable TaoBang(string sql)
      {
          return kn.taobang(sql);
      }
      public DataTable LayDuLieu()
      {
          return kn.LayDuLieu("");
      }
      public int Insert(PhieuYeuCau_Public obj)
      {
          int nParameter = 5;
          string[] name = new string[nParameter];
          object[] value = new object[nParameter];
          name[0] = "@MaPhieuYC";
          value[0] = obj.MaPhieuYC;
          name[1] = "@MaDocGia";
          value[1] = obj.MaDocGia;
          name[2] = "@NgayLapPhieu";
          value[2] = obj.NgayLapPhieu;
          name[3] = "@TongTaiLieu";
          value[3] = obj.TongTaiLieu;
          name[4] = "@MaNhanVien";
          value[4] = obj.MaNhanVien;
          return kn.update("Insert_PhieuYeuCau", name, value, nParameter);
      }
      //load thong tin khi ghi muon
      public DataTable Load_GhiMuon_GiaoVien(string maDocGia)
      {
          int nParamerter = 1;
          string[] name = new string[] {"@MaDocGia"};
          object[] value = new object[] { maDocGia};
          return kn.LayDuLieu("Load_GhiMuon_GiaoVien", name, value, nParamerter);
      }
      public DataTable Load_GhiMuon_SinhVien(string maDocGia)
      {
          int nParamerter = 1;
          string[] name = new string[] { "@MaDocGia" };
          object[] value = new object[] { maDocGia };
          return kn.LayDuLieu("Load_GhiMuon_SinhVien", name, value, nParamerter);
      }
    }
}
